<template>
  <div id="indexComparison" :class="['left', 'contentWidth' , {'mainBig': $store.state.isCollapse ,'mainSmall': !$store.state.isCollapse }]">
    <div class="header">
      <div class="backTo" v-show="isBackShow" @click="back">
        <img src="../../../static/images/back.png" alt="返回" />
      </div>
      <div class="contentTopLeft left">
        <h2 class="title">体征指标项对比</h2>
      </div>
      <maintopright></maintopright>
      <maintopleftbottom></maintopleftbottom>
    </div>
    <router-view></router-view>
  </div>
</template>
<script>
  import maintopright from '@/components/main/maintop/maintopRight'
  import maintopleftbottom from '@/components/main/maintop/maintopLeftBottom'
  export default {
    data() {
      return {
        isBackShow: false,
      }
    },
    watch: {
      $route: {
        handler(val, oldval) {
          this.ind = this.$route.query.ind
          if (val.path.indexOf('/eventsAnalysis/eventsReport') != -1 ) {
            this.isBackShow = false;
          } else {
            this.isBackShow = true;
          }
        },
      },
    },
    mounted() {
      this.isRoute();
    },
    methods: {
      back() {
        //this.$router.push({
        //  path: '/eventsAnalysis/eventsReport',
        //  query: { item: 10 }
        //})
        this.$router.go(-1);
      },
      isRoute() {
        if (this.$route.path.indexOf('/eventsAnalysis/eventsReport') != -1 ) {
          this.isBackShow = false;
        } else {
          this.isBackShow = true;
        }
      },
    },
    components: {
      maintopright,
      maintopleftbottom,
    },
}
</script>
<style scoped>
</style>
